home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / program / door_io.lha / door_io.library / door_io.doc < prev    next >
Text File  |  1995-09-05  |  4KB  |  88 lines

  1. Hi there.. this is the Documentation ;) for the door_io.library.
  2.  
  3. I have written it for all BBS-Door programmers (me included).
  4.  
  5. It should be useful if one wants to input characters (a string) and react
  6. on events in parallel. This is important for MultiUserDungeons (MUD) and 
  7. related things.. I used on in a not_really_MUD named Gore. Its more a 
  8. MUDSG .. multiuserdungeonspladdergame.. 
  9.  
  10. Well.. it is not very funny if you are typing in a command, and when you are done 
  11. with it getting a message "a level 4711 Zombie has shaved you with a chainsaw" :))
  12.  
  13. An other Thing is the metacharacterexpander (what a word ..) 
  14. a "#" is used as a control character. the following character tells what happens:
  15. 0 -> color black
  16. 1 -> color red
  17. 2 -> color green
  18. 3 -> color blue
  19. 4 -> color yellow
  20. 5 -> color magenta
  21. 6 -> color cyan
  22. 7 -> color white
  23. n -> CR/LF
  24. s -> standard colors
  25.  
  26. These packetio-routines were originally not a shared lib, but we wanted to use the
  27. thing in a chatter-library (which will be soon available for AmBoS) and so
  28. the door_io.library was born :)
  29.  
  30. The library and all associated stuff is copyright by A.Haarer 1995+ and it
  31. may be freely used. It may be copied and spread on a non-profit basis.
  32. Commercial use is prohibited without written permission by Author .. ME !! :-)
  33.  
  34. Hum.. btw this program is thingware.. you may send anything to anyone :)
  35.  
  36. _______________________________________________________________________________
  37. Q: What is it for ??? 
  38.  
  39. A: Its a shared library that simplifies i/o operations in BBS-Cli-Doorprograms
  40.    - You are able to wait for Keys AND incoming exec-messages in parallel !
  41.    - You are able to specify a "carrier-lost-hook" to do cleanup when the line
  42.      breaks down
  43.    - it contains a metacharexpander which can generate colored output strings.
  44. ________________________________________________________________________________
  45. Q: How does it work ? 
  46.  
  47. A: The library does it's i/o operations by dospackets and therefore can wait()
  48.    for an input and other applicationspecific messages. The standard input() and
  49.    output() handles are used to determine the handler process.
  50. _________________________________________________________________________________
  51. Q: Why should i use it ? I can also poll the input stream  !
  52.  
  53. A: - Because polling in a multitasking environment ist complete bullshit ;-))
  54.    - Polling does slow down the whole system and is bad design, if other solutions
  55.      are possible.
  56.    - If you are polling single characters, you have to build a string input yourself.
  57.    - polling suxx :)
  58. _________________________________________________________________________________
  59. Q: How do i use it ?
  60.  
  61. A: - Replace your string input function by BOX_getstr()
  62.  
  63.    - Replace your string output function by BOX_getstr() and format the strings
  64.      with sprintf() when required.
  65.  
  66.    - Initialize the opened Library with BOX_start() and supply some parameters
  67.       - meta_on           1 -> the "#" controls the colors of text output
  68.                           0 -> the text output is not changed
  69.       - carrier_lost_hook (optional) is called when the handler returns an error
  70.                           (this is standard in most common bbs programs)
  71.       - exthandler        is called when one of the specified sigbits is set  
  72.       - sigmask           sigmask to trigger the exthandler
  73.  
  74.    - modify the signal mask by BOX_setmask() when required
  75.  
  76.    - Your carrier_lost_hook function should call BOX_stop() and close all resources of
  77.      your program
  78.  
  79.    - YOU MUST DECLARE BOTH HOOKFUNCTIONS with __saveds OR EQUIVALENT !
  80.      (__saveds restores the near data pointer, for some compilers its __geta4)
  81.  
  82.    - Call BOX_stop() when your program quits
  83. _________________________________________________________________________________
  84. Q: How contact the Author ? 
  85.  
  86. A: - Email to MAC@nasus.north.de or MAC@dontpanic.sub.org
  87.    - Call the Castle of Confusion BBS : +49 421 636 7544 or +49 421 636 8643
  88.